British and Soviet ballistic-missile submarines mysteriously disappear. James Bond—MI6 agent 007—is summoned to investigate. On the way he escapes an ambush by Soviet agents in Austria, killing one during a downhill ski chase, and escaping via a Union Flag parachute. Bond learns that the plans for a highly advanced submarine tracking system are on the market in Egypt. There, he encounters Major Anya Amasova—KGB agent Triple X—his rival for the plans. They travel across Egypt together, tracking the microfilm plans, meeting Jaws—a tall assassin with steel teeth—along the way. Bond and Amasova later team up through a truce agreed by their respective superiors and identify the person responsible for the thefts as the shipping tycoon, scientist, and anarchist Karl Stromberg.
While travelling by train to Stromberg's base in Sardinia, Bond saves Amasova from being killed by Jaws, and their cooling rivalry becomes affection. Posing as a marine biologist and his wife, they visit Stromberg's base and discover that he launched a mysterious new supertanker, the Liparus, nine months previously. After they leave the base, Jaws and other armed personnel, including a helicopter pilot named Naomi, chase them, but all attempts fail due to Bond's driving skills and fact that his car – a Lotus Esprit from Q Branch – can convert into a submarine. Jaws retreats once again while Naomi and her other allies are killed. Bond later finds out that the Liparus has never visited any known port or harbour. Amasova discovers that Bond killed her lover in Austria and she vows to Bond that she will kill him once their mission ends.

Later, while aboard an American submarine, Bond and Amasova examine Stromberg's underwater Atlantis base and confirm that he is operating the tracking system. The Liparus then captures the submarine, just as it captured the others. Stromberg sets his plan in motion: the launching of nuclear missiles from the submarines, to destroy Moscow and New York City. This would trigger a global nuclear war, which Stromberg would survive in Atlantis, and subsequently a new civilisation would be established. He leaves for Atlantis with Amasova. Bond frees the captured British, Russian and American submariners and they battle the Liparus '​s crew. Bond reprograms the British and Soviet submarines to destroy each other, saving Moscow and New York. The victorious submariners escape the sinking Liparus on the American submarine.
Bond insists on rescuing Amasova before the submarine has to follow its orders and destroy Atlantis. Bond confronts and kills Stromberg but again encounters Jaws, whom he drops into a shark tank. Jaws fatally bites the shark and swims to freedom. Bond and Amasova flee in an escape pod as Atlantis is sunk. In the pod Amasova reminds Bond that she has vowed to kill him and picks up Bond's gun, but admits to having forgiven him and the two make love. The Royal Navy recovers the pod, and the two spies are seen in intimate embrace through its large window, much to the consternation of Bond and Amasova's superiors.